<?php

require_once('rb.php');
R::setup('mysql:host=ftp.giemiebier.nl:3306;dbname=personify', 'school', 'admin123');

if ($pagetree[2] != "" && isset($pagetree[2])){
    $id = $pagetree[2];
}else{
    $id = "";
}

$pending = R::getAll('select userid1 from pending where userid2 = :id', array(':id'=>$id));
$return = "";
foreach ($pending as $p) {
    
    $return[]['user'] = $p['userid1'];
}

echo json_encode($return);

?>
